﻿using MediatR;
using Microsoft.Extensions.Logging;

namespace CQRSLearn.Features.Products.Notifications
{
    public class RandomHandler : INotificationHandler<ProductCreatedNotification>
    {
        private readonly ILogger<RandomHandler> _logger;

        public RandomHandler(ILogger<RandomHandler> logger)
        {
            _logger = logger;
        }

        public Task Handle(ProductCreatedNotification notification, CancellationToken cancellationToken)
        {
            _logger.LogInformation($"handling notification for product creation with id : {notification.Id}. performing random action.");
            return Task.CompletedTask;
        }
    }
}
